package org.opu.vcforms.datasource;

/**
 *  Data receiver interface
 * @author yura
 */
public interface DataReceiver extends Cloneable {

    /**
     * Returns number of columns requested by the query.
     * @return number of columns requested by the query.
     */
    public int getColumns();

    /**
     * Returns number of requested rows.
     * @return number of requested rows.
     */
    public int getRows();

    /**
     * Sends the query. Uses for SELECT-queries.
     * @param query String - SQL-statement to execute.
     * @return true if executed successfully.
     */
    public boolean sendQuery(String query);

    /**
     *  Return all heads of sended query
     * @return all heads of sended query
     */
    public String[] getHeads();

    /**
     *  Return object at specific row in specific col
     * @param row row number where data is (start from 1)
     * @param col collumn where data is
     * @return object at specific row in specific col
     */
    public Object getObject(int row, String col);

    /**
     *  Return object at specific row in specific col
     * @param row row number where data is (start from 1)
     * @param col collum nnumber where data is (start from 1)
     * @return object at specific row in specific col
     */
    public Object getObject(int row, int col);
}
